﻿Imports ComponentFactory.Krypton.Toolkit

Namespace Classes

    ''' <summary>
    ''' Fonctions relatives a l'interface
    ''' </summary>
    Public Module GUIfonctions
        ' // Returns the list index value for the item matching strSearchValue
        ' // in combo box cbComboBox
        ' // Otherwise returns -1 if not found
        Public Function FindCBIndex(cbComboBox As KryptonComboBox, strSearchValue As String) As Integer
            Dim n As Integer
            For n = 0 To cbComboBox.Items.Count - 1
                If cbComboBox.Items(n).ToString() = strSearchValue Then
                    ' // Return the found index
                    FindCBIndex = n
                    ' // and exit
                    Exit Function
                End If
            Next
            ' // Set not found value
            FindCBIndex = -1
        End Function

        Sub MettrePaletteCourante(ByVal kp As KryptonPalette)
            kp.BasePaletteMode = CardsGen.KryptonPaletteCardsGen.BasePaletteMode
        End Sub
    End Module
End Namespace